<?php
define('MODULE_NAME','user');


require_once './core/service/fanwe.service.php';
$fanwe = &FanweService::instance();
$fanwe->is_group_city = false;
$fanwe->initialize();

$actions = array('login','loginhandle','reg','reghandle','logout','getpwd','sendpwd');
$managers = array('center','top','menu','modify','modifyhandle','password','repwd','order','collect','custom','score','referral');
$action = 'center';

if(isset($_REQUEST['action']))
{
	$action = strtolower($_REQUEST['action']);
	if(!in_array($action,$actions) && !in_array($action,$managers))
		$action = 'center';
}
	
define('ACTION_NAME',$action);

if(in_array(ACTION_NAME,$managers))
{
	if (intval($_FANWE['user']['id']) <= 0)
	{
		fHeader("location: ".U('user/login'));
		exit;
	}
	
	if ($_FANWE['user']['group_type'] == 'Site')
	{
		fHeader("location: ".U('site/center'));
		exit;
	}
}

require import('module/user');

switch(ACTION_NAME)
{
	case 'login':
		UserModule::login();
	break;
	
	case 'loginhandle':
		UserModule::loginHandle();
	break;
	
	case 'reg':
		UserModule::reg();
	break;
	
	case 'reghandle':
		UserModule::regHandle();
	break;
	
	case 'logout':
		UserModule::logout();
	break;
	
	case 'center':
		UserModule::center();
	break;
	
	case 'top':
		UserModule::top();
	break;
	
	case 'menu':
		UserModule::menu();
	break;
	
	case 'modify':
		UserModule::modify();
	break;
	
	case 'modifyhandle':
		UserModule::modifyHandle();
	break;
	
	case 'password':
		UserModule::password();
	break;
	
	case 'repwd':
		UserModule::repwd();
	break;
	
	case 'order':
		UserModule::order();
	break;
	
	case 'collect':
		UserModule::collect();
	break;
	
	case 'custom':
		UserModule::custom();
	break;
	
	case 'score':
		UserModule::score();
	break;
	
	case 'referral':
		UserModule::referral();
	break;
	
	case 'getpwd':
		UserModule::getPwd();
	break;
	
	case 'sendpwd':
		UserModule::sendPwd();
	break;
}
?>